package com.ruoyi.engineering.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.engineering.mapper.EngineeringMapper;
import com.ruoyi.engineering.domain.Engineering;
import com.ruoyi.engineering.service.IEngineeringService;

/**
 * 工程信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class EngineeringServiceImpl implements IEngineeringService
{
    @Autowired
    private EngineeringMapper engineeringMapper;

    /**
     * 查询工程信息
     *
     * @param id 工程信息主键
     * @return 工程信息
     */
    @Override
    public Engineering selectEngineeringById(Long id)
    {
        return engineeringMapper.selectEngineeringById(id);
    }

    /**
     * 查询工程信息列表
     *
     * @param engineering 工程信息
     * @return 工程信息
     */
    @Override
    public List<Engineering> selectEngineeringList(Engineering engineering)
    {
        return engineeringMapper.selectEngineeringList(engineering);
    }

    /**
     * 新增工程信息
     *
     * @param engineering 工程信息
     * @return 结果
     */
    @Override
    public int insertEngineering(Engineering engineering)
    {
        engineering.setCreateTime(DateUtils.getNowDate());
        return engineeringMapper.insertEngineering(engineering);
    }

    /**
     * 修改工程信息
     *
     * @param engineering 工程信息
     * @return 结果
     */
    @Override
    public int updateEngineering(Engineering engineering)
    {
        engineering.setUpdateTime(DateUtils.getNowDate());
        return engineeringMapper.updateEngineering(engineering);
    }

    /**
     * 批量删除工程信息
     *
     * @param ids 需要删除的工程信息主键
     * @return 结果
     */
    @Override
    public int deleteEngineeringByIds(Long[] ids)
    {
        return engineeringMapper.deleteEngineeringByIds(ids);
    }


    /**
     * 批量逻辑删除工程信息
     *
     * @param ids 需要删除的工程信息主键
     * @return 结果
     */
    @Override
    public int logicDeleteEngineering(Long[] ids,String delType,Long delUser)
    {
        return engineeringMapper.logicDeleteEngineering(ids,delType,delUser);
    }

    /**
     * 删除工程信息信息
     *
     * @param id 工程信息主键
     * @return 结果
     */
    @Override
    public int deleteEngineeringById(Long id)
    {
        return engineeringMapper.deleteEngineeringById(id);
    }
}
